﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Cofe.Core.Interfaces;
using Cofe.Core.Property;

namespace Cofe.Core.Implements
{
    [Export(typeof(ICofeService))]
    [ServicePriority(ServicePriorityAttribute.DefaultPriority_NONE)] //Run unless no other generator generates
    public class NotExistsPrimaryPPRegenerator : IEntryPrimaryPPRegenerator
    {
        public Task<IPropertyProvider> RegenerateAsync(IPropertyCache propertyCache)
        {
            string fullName = propertyCache.GetOneProperty<string>(CofeProperties.FullParseName);
            IPropertyProvider retVal = NotExistsPropertyProvider.FromFullParseName(fullName);

            return Task<IPropertyProvider>.FromResult(retVal);
        }
    }
}
